package com.dy.course.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ControllerAdvice;
@ControllerAdvice
public class BaseController {
	
	protected Logger logger = Logger.getLogger(getClass());
	
	@Autowired
	protected HttpServletRequest request;
	
	@Autowired
	protected HttpServletResponse response;
	
	@Autowired
	protected HttpSession session;
	

	protected ResponseMessage<?> constructNullResponse(){
		ResponseMessage<?> rm = new ResponseMessage<Object>();
		return rm;
	}
	
	protected <T> ResponseMessage<T> constructResponse(T obj){
		ResponseMessage<T> rm = new ResponseMessage<T>();
		rm.setBody(obj);
		return rm;
	}
	
	
}
